<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<svg width="400" height="400">
    <rect x="10" y="10" width="80" height="80">
        <animate id="anim" attributeName="x" from="10" to="310" dur="10s" begin="0s"/>
    </rect>
</svg>
<script>
'use strict';

// From UseCounter.h
var SVGSMILAnimationElementTiming = 1504;
var SVGSMILBeginEndAnimationElement = 1505;

test(() => {
    var animation = document.getElementById('anim');
    assert_false(internals.isUseCounted(document, SVGSMILAnimationElementTiming));
    animation.getSimpleDuration();
    assert_true(internals.isUseCounted(document, SVGSMILAnimationElementTiming));

    assert_false(internals.isUseCounted(document, SVGSMILBeginEndAnimationElement));
    animation.endElement();
    assert_true(internals.isUseCounted(document, SVGSMILBeginEndAnimationElement));
}, 'endElement is use counted');

</script>
